layui.use(["jquery","layer",'table'],function () {
    var $ = layui.jquery;
    var layer = layui.layer;
    var table = layui.table;
    var courseId  = JSON.parse(localStorage.getItem("courseId"));
    getTable();
    function getTable() {
        $.ajax({
            url:"/product/getProductExamine",
            data:{'courseId':courseId,'type':3},
            type:'post',
            dataType:'json',
            success:function (data) {
                console.log(data.data);
                demoTable(data.data);
            }
        });
    }
    function demoTable(data){
        table.render({
            elem: '#demoTable',
            title: '商品审核详情',
            data: data,
            width: 800,
            cols: [[
                {field: 'implementDate', title: '审核时间', align: 'center', width: 200},
                {field: 'account', title: '审核人员', align: 'center', width: 195},
                {field: 'result', title: '审核结果', align: 'center', width: 200,templet:function (data) {
                        if(data.result==1){
                            return '审核通过';
                        }else if(data.result==2){
                            return '待审核';
                        }else if(data.result==3){
                            return '审核驳回';
                        }
                    }},
                {field: 'remarks', title: '反馈详情', align: 'center', width: 200,templet:function (data) {
                        if(data.remarks == null){
                            return '无内容';
                        }else{
                            return data.remarks;
                        }
                    }}
            ]]
        })
    }
})